<?php
if($sys_act == "changeTableVal")
{
	$tablename = $table; // 表名
	$idname = $id_name; // 表主键id名
	$idvalue = $id_value; // 表主键id值
	$newfield = $field; // 修改哪个字段
	$gval = $gvalue; // 修改字段值
	
	if($_SESSION["admin"]["user"])
	{
		$sql = "UPDATE ".$prefix.$tablename." SET ".$newfield."='".$gval."' WHERE ".$idname."=".$idvalue."";
		$DB->qgQuery($sql);
		$result["state"] = 1;
		$json = json_encode($result);
		echo $json;
		exit;
	}
}
//收起展开左侧菜单
elseif($sys_act == "leftClick")
{
	if($type=="open")
	{
		$sql = "UPDATE ".$prefix."admin SET iflefton='1' WHERE id='".$_SESSION["admin"]["id"]."'";
		$DB->qgQuery($sql);
		$_SESSION["admin"]["iflefton"] = 1;
	}
	elseif($type=="close")
	{
		$sql = "UPDATE ".$prefix."admin SET iflefton='0' WHERE id='".$_SESSION["admin"]["id"]."'";
		$DB->qgQuery($sql);
		$_SESSION["admin"]["iflefton"] = 0;
	}
	$result["msg"] = $sql;
	$json = json_encode($result);
	echo $json;
	exit;
}
//清除缓存
elseif($sys_act == "clearCache")
{
	$delfolder = array('phpok_tplc','phpok_tplc/m_','admin_tplc','cache');
	foreach($delfolder AS $key=>$value)
	{
		$FS->qgDelete("data/".$value);		
	}
	$result["state"] = 1;
	$json = json_encode($result);
	echo $json;
	exit;
}
//修改样式
elseif($sys_act == "skinChange")
{
	if($skin)
	{
		$sql = "UPDATE ".$prefix."admin SET skinname='".$skin."' WHERE id='".$_SESSION["admin"]["id"]."'";
		$DB->qgQuery($sql);
		$_SESSION["admin"]["skinname"] = $skin;
		$result["state"] = 1;
		$json = json_encode($result);
		echo $json;
		exit;
	}
}
?>